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;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA","sources":["webpack://quran.com/src/pages/[chapterId]/[verseId]/index.tsx","webpack://quran.com/sentry-wrapper-module","webpack://quran.com/./src/utils/plainTranslationText.ts","webpack://quran.com/external commonjs \"@reduxjs/toolkit\"","webpack://quran.com/external commonjs \"@sentry/nextjs\"","webpack://quran.com/external commonjs \"@xstate/react\"","webpack://quran.com/external commonjs \"classnames\"","webpack://quran.com/external commonjs \"clipboard-copy\"","webpack://quran.com/external commonjs \"fuse.js\"","webpack://quran.com/external commonjs \"humps\"","webpack://quran.com/external commonjs \"lodash/capitalize\"","webpack://quran.com/external commonjs \"lodash/debounce\"","webpack://quran.com/external commonjs \"lodash/findKey\"","webpack://quran.com/external commonjs \"lodash/groupBy\"","webpack://quran.com/external commonjs \"lodash/isArray\"","webpack://quran.com/external commonjs \"lodash/random\"","webpack://quran.com/external commonjs \"lodash/range\"","webpack://quran.com/external commonjs \"lodash/sample\"","webpack://quran.com/external commonjs \"lodash/uniq\"","webpack://quran.com/external commonjs \"next-seo\"","webpack://quran.com/external commonjs \"next-translate/Trans\"","webpack://quran.com/external commonjs \"next-translate/useTranslation\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/app-router-context.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/head-manager-context.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/i18n/detect-domain-locale.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/i18n/normalize-locale-path.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/is-plain-object.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/loadable.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/mitt.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/page-path/denormalize-page-path.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router-context.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/add-locale.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/add-path-prefix.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/compare-states.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/format-next-pathname-info.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/format-url.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/get-asset-path-from-route.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/get-next-pathname-info.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/is-bot.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/is-dynamic.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/parse-path.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/parse-relative-url.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/path-has-prefix.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/querystring.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/remove-trailing-slash.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/resolve-rewrites.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/route-matcher.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/router/utils/route-regex.js\"","webpack://quran.com/external commonjs \"next/dist/shared/lib/utils.js\"","webpack://quran.com/external commonjs \"next/head\"","webpack://quran.com/external commonjs \"next/router\"","webpack://quran.com/external commonjs \"react\"","webpack://quran.com/external commonjs \"react-hotkeys-hook\"","webpack://quran.com/external commonjs \"react-redux\"","webpack://quran.com/external commonjs \"react-virtuoso\"","webpack://quran.com/external commonjs \"react/jsx-runtime\"","webpack://quran.com/external commonjs \"redux-persist\"","webpack://quran.com/external commonjs \"refresh-fetch\"","webpack://quran.com/external commonjs \"xstate\"","webpack://quran.com/external commonjs \"xstate/lib/actions\"","webpack://quran.com/external module \"@radix-ui/react-checkbox\"","webpack://quran.com/external module \"@radix-ui/react-collapsible\"","webpack://quran.com/external module \"@radix-ui/react-dialog\"","webpack://quran.com/external module \"@radix-ui/react-dropdown-menu\"","webpack://quran.com/external module \"@radix-ui/react-popover\"","webpack://quran.com/external module \"@radix-ui/react-radio-group\"","webpack://quran.com/external module \"@radix-ui/react-separator\"","webpack://quran.com/external module \"@radix-ui/react-tooltip\"","webpack://quran.com/external module \"@radix-ui/react-visually-hidden\"","webpack://quran.com/external module \"firebase/compat/analytics\"","webpack://quran.com/external module \"firebase/compat/app\"","webpack://quran.com/external module \"js-cookie\"","webpack://quran.com/external module \"react-hook-form\"","webpack://quran.com/external module \"react-joyride\"","webpack://quran.com/external module \"react-toastify\"","webpack://quran.com/external module \"swr\"","webpack://quran.com/external module \"swr/immutable\"","webpack://quran.com/external node-commonjs \"querystring\""],"sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable react-func/max-lines-per-function */\nimport { GetStaticPaths, GetStaticProps, NextPage } from 'next';\nimport { useRouter } from 'next/router';\nimport useTranslation from 'next-translate/useTranslation';\n\nimport { getChapterIdBySlug, getChapterVerses, getPagesLookup } from '@/api';\nimport NextSeoWrapper from '@/components/NextSeoWrapper';\nimport QuranReader from '@/components/QuranReader';\nimport { getChapterOgImageUrl } from '@/lib/og';\nimport Error from '@/pages/_error';\nimport { getQuranReaderStylesInitialState } from '@/redux/defaultSettings/util';\nimport { getDefaultWordFields, getMushafId } from '@/utils/api';\nimport { getAllChaptersData, getChapterData } from '@/utils/chapter';\nimport { getLanguageAlternates, toLocalizedNumber, toLocalizedVersesRange } from '@/utils/locale';\nimport { getCanonicalUrl, getVerseNavigationUrl } from '@/utils/navigation';\nimport getPlainTranslationText from '@/utils/plainTranslationText';\nimport {\n REVALIDATION_PERIOD_ON_ERROR_SECONDS,\n ONE_WEEK_REVALIDATION_PERIOD_SECONDS,\n} from '@/utils/staticPageGeneration';\nimport {\n getToAndFromFromRange,\n isValidVerseRange,\n isValidVerseId,\n isValidVerseNumber,\n} from '@/utils/validator';\nimport { generateVerseKeysBetweenTwoVerseKeys } from '@/utils/verseKeys';\nimport { ChapterResponse, VersesResponse } from 'types/ApiResponses';\nimport ChaptersData from 'types/ChaptersData';\nimport MetaData from 'types/MetaData';\nimport { QuranReaderDataType } from 'types/QuranReader';\n\ntype VerseProps = {\n chapterResponse?: ChapterResponse;\n versesResponse?: VersesResponse;\n isVerse?: boolean;\n hasError?: boolean;\n chaptersData?: ChaptersData;\n};\n\nconst Verse: NextPage<VerseProps> = ({ chapterResponse, versesResponse, hasError, isVerse }) => {\n const { t, lang } = useTranslation('common');\n const {\n query: { verseId },\n } = useRouter();\n if (hasError || !versesResponse.verses.length) {\n return <Error statusCode={500} />;\n }\n\n const path = getVerseNavigationUrl(chapterResponse.chapter.slug, verseId as string);\n return (\n <>\n <NextSeoWrapper\n title={`${t('surah')} ${chapterResponse.chapter.transliteratedName} - ${\n isVerse\n ? toLocalizedNumber(Number(verseId), lang)\n : toLocalizedVersesRange(verseId as string, lang)\n }`}\n image={getChapterOgImageUrl({\n chapterId: chapterResponse.chapter.id,\n verseNumber: isVerse ? Number(verseId) : undefined,\n locale: lang,\n })}\n imageWidth={1200}\n imageHeight={630}\n canonical={getCanonicalUrl(lang, path)}\n languageAlternates={getLanguageAlternates(path)}\n description={getOgDescription(versesResponse, isVerse, lang)}\n />\n <QuranReader\n initialData={versesResponse}\n id={chapterResponse.chapter.id}\n quranReaderDataType={\n isVerse ? QuranReaderDataType.Verse : QuranReaderDataType.ChapterVerseRanges\n }\n />\n </>\n );\n};\n\nexport const getStaticProps: GetStaticProps = async ({ params, locale }) => {\n let chapterIdOrSlug = String(params.chapterId);\n const verseIdOrRange = String(params.verseId);\n // 1. make sure the chapter Id/slug is valid using BE since slugs are stored in BE first\n const sluggedChapterId = await getChapterIdBySlug(chapterIdOrSlug, locale);\n if (sluggedChapterId) {\n chapterIdOrSlug = sluggedChapterId;\n }\n const chaptersData = await getAllChaptersData(locale);\n // 2. make sure that verse id/range are valid before calling BE to get the verses.\n if (\n !isValidVerseId(chaptersData, chapterIdOrSlug, verseIdOrRange) &&\n !isValidVerseRange(chaptersData, chapterIdOrSlug, verseIdOrRange)\n ) {\n return { notFound: true };\n }\n /*\n Since we already validated the value, if the verseIdOrRange is a number it means we are\n viewing the verse's page otherwise it's a range page.\n */\n const isVerse = isValidVerseNumber(verseIdOrRange);\n const defaultMushafId = getMushafId(\n getQuranReaderStylesInitialState(locale).quranFont,\n getQuranReaderStylesInitialState(locale).mushafLines,\n ).mushaf;\n // common API params between a single verse and range of verses.\n let apiParams = {\n ...getDefaultWordFields(getQuranReaderStylesInitialState(locale).quranFont),\n mushaf: defaultMushafId,\n };\n const metaData = { numberOfVerses: 1 } as MetaData;\n let [from, to] = [null, null];\n if (isVerse) {\n apiParams = { ...apiParams, ...{ page: verseIdOrRange, perPage: 1 } };\n } else {\n const [fromVerseNumber, toVerseNumber] = getToAndFromFromRange(verseIdOrRange);\n [from, to] = getToAndFromFromRange(verseIdOrRange).map((ayah) => `${chapterIdOrSlug}:${ayah}`);\n apiParams = { ...apiParams, ...{ from, to } };\n metaData.from = from;\n metaData.to = to;\n metaData.numberOfVerses = Number(toVerseNumber) - Number(fromVerseNumber) + 1;\n }\n try {\n const pagesLookupResponse = await getPagesLookup({\n chapterNumber: Number(chapterIdOrSlug),\n mushaf: defaultMushafId,\n from: isVerse ? `${chapterIdOrSlug}:${verseIdOrRange}` : metaData.from,\n to: isVerse ? `${chapterIdOrSlug}:${verseIdOrRange}` : metaData.to,\n });\n\n // if it's range, we need to set the per page as the number of verses of the first page of the range in the actual Mushaf\n if (!isVerse) {\n const firstRangeMushafPage = Object.keys(pagesLookupResponse.pages)[0];\n const firstRangeMushafPageLookup = pagesLookupResponse.pages[firstRangeMushafPage];\n const firstRangeMushafPageNumberOfVerses = generateVerseKeysBetweenTwoVerseKeys(\n chaptersData,\n firstRangeMushafPageLookup.from,\n firstRangeMushafPageLookup.to,\n ).length;\n apiParams = { ...apiParams, ...{ perPage: firstRangeMushafPageNumberOfVerses } };\n }\n\n const versesResponse = await getChapterVerses(chapterIdOrSlug, locale, apiParams);\n // if any of the APIs have failed due to internal server error, we will still receive a response but the body will be something like {\"status\":500,\"error\":\"Internal Server Error\"}.\n const chapterData = getChapterData(chaptersData, chapterIdOrSlug);\n if (!chapterData) {\n return {\n props: {\n hasError: true,\n },\n revalidate: REVALIDATION_PERIOD_ON_ERROR_SECONDS, // 35 seconds will be enough time before we re-try generating the page again.\n };\n }\n return {\n props: {\n chaptersData,\n chapterResponse: {\n chapter: { ...chapterData, id: chapterIdOrSlug },\n },\n versesResponse: {\n ...versesResponse,\n pagesLookup: pagesLookupResponse,\n metaData,\n },\n isVerse,\n },\n revalidate: ONE_WEEK_REVALIDATION_PERIOD_SECONDS, // verses will be generated at runtime if not found in the cache, then cached for subsequent requests for 7 days.\n };\n } catch (error) {\n return {\n props: {\n hasError: true,\n },\n revalidate: REVALIDATION_PERIOD_ON_ERROR_SECONDS, // 35 seconds will be enough time before we re-try generating the page again.\n };\n }\n};\n\n// Generates the description and open graph description for the page.\nconst getOgDescription = (versesResponse: VersesResponse, isVerse: boolean, lang: string) => {\n let ogText = '';\n\n // Single verse pages\n if (isVerse) {\n const verse = versesResponse.verses[0];\n ogText =\n verse?.translations?.length > 0\n ? getPlainTranslationText(verse?.translations[0]?.text)\n : verse?.textImlaeiSimple;\n }\n\n // For verse ranges, return the first 3 verses in the format of `(verse number) verse translation text`\n else {\n const firstThreeVerses = versesResponse.verses.slice(0, 3);\n ogText = firstThreeVerses\n .map((verse) => {\n return `(${toLocalizedNumber(Number(verse.verseNumber), lang)}) ${\n verse?.translations?.length > 0\n ? getPlainTranslationText(verse?.translations[0]?.text)\n : verse?.textImlaeiSimple\n }`;\n })\n .join(' ');\n }\n\n // Check if the text is longer than 300 characters, if it is, trim it and add ellipsis.\n if (ogText.length > 300) {\n ogText = `${ogText.substring(0, 297)}...`;\n }\n\n return ogText;\n};\nexport const getStaticPaths: GetStaticPaths = async () => ({\n paths: [], // no pre-rendered chapters at build time.\n fallback: 'blocking', // will server-render pages on-demand if the path doesn't exist.\n});\n\nexport default Verse;\n","import * as Sentry from '@sentry/nextjs';\nimport * as serverComponentModule from '__SENTRY_WRAPPING_TARGET_FILE__.cjs';\nexport * from '__SENTRY_WRAPPING_TARGET_FILE__.cjs';\n\n/*\n * This file is a template for the code which will be substituted when our webpack loader handles non-API files in the\n * `pages/` directory.\n *\n * We use `__SENTRY_WRAPPING_TARGET_FILE__.cjs` as a placeholder for the path to the file being wrapped. Because it's not a real package,\n * this causes both TS and ESLint to complain, hence the pragma comments below.\n */\n\nconst userPageModule = serverComponentModule ;\n\nconst pageComponent = userPageModule ? userPageModule.default : undefined;\n\nconst origGetInitialProps = pageComponent ? pageComponent.getInitialProps : undefined;\nconst origGetStaticProps = userPageModule ? userPageModule.getStaticProps : undefined;\nconst origGetServerSideProps = userPageModule ? userPageModule.getServerSideProps : undefined;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst getInitialPropsWrappers = {\n '/_app': Sentry.wrapAppGetInitialPropsWithSentry,\n '/_document': Sentry.wrapDocumentGetInitialPropsWithSentry,\n '/_error': Sentry.wrapErrorGetInitialPropsWithSentry,\n};\n\nconst getInitialPropsWrapper = getInitialPropsWrappers['/[chapterId]/[verseId]'] || Sentry.wrapGetInitialPropsWithSentry;\n\nif (pageComponent && typeof origGetInitialProps === 'function') {\n pageComponent.getInitialProps = getInitialPropsWrapper(origGetInitialProps) ;\n}\n\nconst getStaticProps =\n typeof origGetStaticProps === 'function'\n ? Sentry.wrapGetStaticPropsWithSentry(origGetStaticProps, '/[chapterId]/[verseId]')\n : undefined;\nconst getServerSideProps =\n typeof origGetServerSideProps === 'function'\n ? Sentry.wrapGetServerSidePropsWithSentry(origGetServerSideProps, '/[chapterId]/[verseId]')\n : undefined;\n\nconst pageWrapperTemplate = pageComponent ? Sentry.wrapPageComponentWithSentry(pageComponent ) : pageComponent;\n\nexport { pageWrapperTemplate as default, getServerSideProps, getStaticProps };\n","// Remove html tags and other special characters from translation text\nconst getPlainTranslationText = (translationText: string): string => {\n // Remove the sup tags and all the content inside them\n return translationText.replace(/<sup[^>]*>.*?<\\/sup>/g, '');\n};\n\nexport default getPlainTranslationText;\n","module.exports = require(\"@reduxjs/toolkit\");","module.exports = require(\"@sentry/nextjs\");","module.exports = require(\"@xstate/react\");","module.exports = require(\"classnames\");","module.exports = require(\"clipboard-copy\");","module.exports = require(\"fuse.js\");","module.exports = require(\"humps\");","module.exports = require(\"lodash/capitalize\");","module.exports = require(\"lodash/debounce\");","module.exports = require(\"lodash/findKey\");","module.exports = require(\"lodash/groupBy\");","module.exports = require(\"lodash/isArray\");","module.exports = require(\"lodash/random\");","module.exports = require(\"lodash/range\");","module.exports = require(\"lodash/sample\");","module.exports = require(\"lodash/uniq\");","module.exports = require(\"next-seo\");","module.exports = require(\"next-translate/Trans\");","module.exports = require(\"next-translate/useTranslation\");","module.exports = require(\"next/dist/shared/lib/app-router-context.js\");","module.exports = require(\"next/dist/shared/lib/head-manager-context.js\");","module.exports = require(\"next/dist/shared/lib/i18n/detect-domain-locale.js\");","module.exports = require(\"next/dist/shared/lib/i18n/normalize-locale-path.js\");","module.exports = require(\"next/dist/shared/lib/is-plain-object.js\");","module.exports = require(\"next/dist/shared/lib/loadable.js\");","module.exports = require(\"next/dist/shared/lib/mitt.js\");","module.exports = require(\"next/dist/shared/lib/page-path/denormalize-page-path.js\");","module.exports = require(\"next/dist/shared/lib/router-context.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/add-locale.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/add-path-prefix.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/compare-states.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/format-next-pathname-info.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/format-url.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/get-asset-path-from-route.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/get-next-pathname-info.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/is-bot.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/is-dynamic.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/parse-path.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/parse-relative-url.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/path-has-prefix.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/querystring.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/remove-trailing-slash.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/resolve-rewrites.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/route-matcher.js\");","module.exports = require(\"next/dist/shared/lib/router/utils/route-regex.js\");","module.exports = require(\"next/dist/shared/lib/utils.js\");","module.exports = require(\"next/head\");","module.exports = require(\"next/router\");","module.exports = require(\"react\");","module.exports = require(\"react-hotkeys-hook\");","module.exports = require(\"react-redux\");","module.exports = require(\"react-virtuoso\");","module.exports = require(\"react/jsx-runtime\");","module.exports = require(\"redux-persist\");","module.exports = require(\"refresh-fetch\");","module.exports = require(\"xstate\");","module.exports = require(\"xstate/lib/actions\");","module.exports = import(\"@radix-ui/react-checkbox\");;","module.exports = import(\"@radix-ui/react-collapsible\");;","module.exports = import(\"@radix-ui/react-dialog\");;","module.exports = import(\"@radix-ui/react-dropdown-menu\");;","module.exports = import(\"@radix-ui/react-popover\");;","module.exports = import(\"@radix-ui/react-radio-group\");;","module.exports = import(\"@radix-ui/react-separator\");;","module.exports = import(\"@radix-ui/react-tooltip\");;","module.exports = import(\"@radix-ui/react-visually-hidden\");;","module.exports = import(\"firebase/compat/analytics\");;","module.exports = import(\"firebase/compat/app\");;","module.exports = import(\"js-cookie\");;","module.exports = import(\"react-hook-form\");;","module.exports = import(\"react-joyride\");;","module.exports = import(\"react-toastify\");;","module.exports = import(\"swr\");;","module.exports = import(\"swr/immutable\");;","module.exports = require(\"querystring\");"],"names":["Verse","chapterResponse","versesResponse","hasError","isVerse","t","lang","useTranslation","query","verseId","useRouter","verses","length","_jsx","Error","statusCode","path","getVerseNavigationUrl","chapter","slug","_jsxs","_Fragment","NextSeoWrapper","title","transliteratedName","toLocalizedNumber","Number","toLocalizedVersesRange","image","getChapterOgImageUrl","chapterId","id","verseNumber","undefined","locale","imageWidth","imageHeight","canonical","getCanonicalUrl","languageAlternates","getLanguageAlternates","description","getOgDescription","QuranReader","initialData","quranReaderDataType","QuranReaderDataType","ChapterVerseRanges","getStaticProps","params","chapterIdOrSlug","String","verseIdOrRange","sluggedChapterId","getChapterIdBySlug","chaptersData","getAllChaptersData","isValidVerseId","isValidVerseRange","notFound","isValidVerseNumber","defaultMushafId","getMushafId","getQuranReaderStylesInitialState","quranFont","mushafLines","mushaf","apiParams","getDefaultWordFields","metaData","numberOfVerses","from","to","page","perPage","fromVerseNumber","toVerseNumber","getToAndFromFromRange","map","ayah","pagesLookupResponse","getPagesLookup","chapterNumber","firstRangeMushafPage","Object","keys","pages","firstRangeMushafPageLookup","firstRangeMushafPageNumberOfVerses","generateVerseKeysBetweenTwoVerseKeys","getChapterVerses","chapterData","getChapterData","props","revalidate","REVALIDATION_PERIOD_ON_ERROR_SECONDS","pagesLookup","ONE_WEEK_REVALIDATION_PERIOD_SECONDS","error","ogText","verse","translations","getPlainTranslationText","text","textImlaeiSimple","firstThreeVerses","slice","join","substring","getStaticPaths","paths","fallback","translationText","replace"],"sourceRoot":""}
|